package com.example.sneakerappforme1105.DTO;

import com.example.sneakerappforme1105.bean.CartItem;

public class CartItemDTO {

    private long cartId; // 外键  一对多
    private long goodsId; // 外键   一对多
    private int num; // 商品数量   一项商品
    private double price; // 单项商品总价  一项商品的价格
    private String size; // 鞋码数,衣服尺寸

    public long getCartId() {
        return cartId;
    }

    public void setCartId(long cartId) {
        this.cartId = cartId;
    }

    public long getGoodsId() {
        return goodsId;
    }

    public void setGoodsId(long goodsId) {
        this.goodsId = goodsId;
    }

    public int getNum() {
        return num;
    }

    public void setNum(int num) {
        this.num = num;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public String getSize() {
        return size;
    }

    public void setSize(String size) {
        this.size = size;
    }


    public static CartItemDTO copyCartItemWithoutId(CartItem cartItem) {
        CartItemDTO cartItemDTO = new CartItemDTO();
        cartItemDTO.setCartId(cartItem.getCartId());
        cartItemDTO.setNum(cartItem.getNum());
        cartItemDTO.setPrice(cartItem.getPrice());
        cartItemDTO.setGoodsId(cartItem.getGoodsId());
        cartItemDTO.setSize(cartItem.getSize());
        return cartItemDTO;
    }
}
